require('dotenv').config();
const fs = require("fs-extra")
const path = require("path")



function publish() {
  const srcDir = path.join(process.cwd(), "src")
  const targetDir = process.env.TARGET_DIR
  if (!targetDir) {
    console.error("TARGET_DIR is not set")
    return
  }
  fs.ensureDirSync(targetDir)
  fs.emptyDirSync(targetDir)
  fs.copySync(srcDir, targetDir)
}

publish()